{extend name="web/public/base" /}
{block name="header"}
<script type="text/javascript" src="__PUBLIC__/ueditor/ueditor.config.js"></script>
<script type="text/javascript" src="__PUBLIC__/ueditor/ueditor.all.js"></script>
{/block}
{block name="main"}
<section class="scrollable padder">
    <ul class="breadcrumb no-border no-radius b-b b-light pull-in">
        <li><a><i class="fa fa-home"></i> 首页</a></li>
        <li class="active">文件管理</li>
        <li class="active">{$title}</li>
    </ul>
    <div class="row">
        <div class="col-sm-12">
            <section class="panel panel-default">
                <header class="panel-heading font-bold">{$title}</header>
                <div class="panel-body">
                    <form id="ajaxform" action="{:url('')}" role="form" method="post" onsubmit="return false;"
                          autocomplete="off">
                        <div class="row col-md-10">
                            <div class="clearfix">
                                <div class="form-group col-sm-12">
                                    <label>收件人</label>
                                    <input type="text" id="touser" name="touser" class="form-control" placeholder="收件人编号"
                                           value="">
                                </div>
                                <div class="form-group col-sm-12">
                                    <label>信息标题</label>
                                    <input type="text" id="title" name="title" class="form-control" placeholder="信息标题"
                                           value="">
                                </div>
                                <div class="form-group col-sm-12">
                                    <label>内容</label>
                                    <textarea name="content" id="container">{$docInfo['content']|default=''}</textarea>
                                    <script type="text/javascript">
                                        var ue = UE.getEditor('container', {
                                            initialFrameWidth: 1270,
                                            initialFrameHeight: 200
                                        });
                                    </script>
                                </div>
                            </div>
                        </div>
                        <footer class="panel-footer text-right bg-light lter col-sm-10">
                            <button type="submit" class="btn btn-success btn-s-xs">提 交</button>
                        </footer>
                    </form>
                </div>
            </section>
        </div>
    </div>
</section>
{/block}
{block name="script"}
<script type="text/javascript">
    $(function () {
        $.validator.setDefaults({
            submitHandler: function () {
                ajaxSubmit();
            },
            highlight: function (element, errorClass) {
                $(element).css('border', '2px solid red');
            },
            unhighlight: function (element, errorClass) {
                $(element).css('border', '1px solid green');
            }
        });

        $('#ajaxform').validate({
            rules: {
                touser: "required",
                title: "required",
                container: 'required'
            },
            messages: {
                touser: "请输入收件人编号",
                title: "请输入信息标题",
                container:'请输入信息内容'
            }
        });
    })
</script>
{/block}
